home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / rsh.dis / Rsh.dist
Encoding:
Korn shell script  |  1994-04-24  |  1.4 KB  |  50 lines

  1. #!/usr/bin/ksh
  2. MY_SHELL='/bin/Rsh'
  3. FORTUNE='/usr/games/fortune'
  4. TERM=console
  5. mesg n
  6.     
  7. sh /etc/profile
  8. MY_SHELL='/bin/Rsh'
  9. clear
  10. dialog --menu "       *******Welcome to `hostname`*******\n\n Enter Choice:\n"  21 60 10 \
  11. "1" "Usenet news" \
  12. "2" "Internet mail" \
  13. "3"    "Internet talk" \
  14. "4" "Gnu's Bourne Again Shell" \
  15. "5" "Gnu's EMACS environment" \
  16. "6"    "XWindow environment (MUST be on console to do so!)" \
  17. "7"    "Note to SysAdmin" \
  18. "8" "Exit (i.e., logout)" \
  19. "9"    "New users read this!" 2>/tmp/mychoice
  20. chmod ugoa+w /tmp/mychoice
  21.  
  22. #this lets the user choose who they wanna talk to.
  23. dotalk()    {
  24.     dialog --title TALK: --inputbox "to whom?" 10 30 2>/tmp/talkchoice
  25.     talk `cat /tmp/talkchoice`
  26.     rm -f /tmp/talkchoice
  27.     exec $MY_SHELL
  28. }
  29.  
  30. #echo -n '        Your Choice: '    
  31. choice=`cat /tmp/mychoice`
  32. #read choice
  33. clear
  34. case ${choice:-0} in
  35. 0)    (dialog --infobox "what?" 3 20; sleep 1); exec $MY_SHELL ;;
  36. 1)    (trn -r 2>/dev/null); exec $MY_SHELL ;;
  37. 2)    (elm); exec $MY_SHELL ;;
  38. 3)    dotalk; exec $MY_SHELL ;;
  39. 4)    echo 'You are now in bash; type "exit" to return to the menu';
  40.     echo ''; 
  41.     (bash -login); exec $MY_SHELL ;;
  42. 5)    (emacs -nw); exec $MY_SHELL ;;
  43. #5)    (clear;echo ' ';$FORTUNE;echo '';echo  'hit enter key...';read junk); $MY_SHELL ;;
  44. 6)    (exec startx) ; exec $MY_SHELL ;;
  45. 7)    (elm root); exec $MY_SHELL ;;
  46. 8)    (rm -f /tmp/mychoice) ; exit ;;
  47. 9)    (echo 'choose 6 & ask sysAdmin about account info...'; read junk); exec $MY_SHELL ;; 
  48. *)    (rm -f /tmp/mychoice); exec $MY_SHELL ;;
  49. esac
  50.